<?php

namespace App\Models\Traits;

use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Builder;

trait HasScopeInquire
{
	public function scopeInquire(Builder $builder, $condition = null): Builder
	{
		if (in_array($condition, array_keys(self::$inquireConditions))) {
			$condition = Str::camel($condition);
			return $builder->$condition();
		}
		return $builder;
	}
}
